/*
 * @Author: your name
 * @Date: 2021-05-12 19:59:05
 * @LastEditTime: 2021-05-17 10:31:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \blog-server\routes\getPubKey.js
 */
const express = require('express');
const { getPublicKey } = require('../core/rsaControl')
const router = express.Router();
const Key = require('../models/Key');
const assert = require('http-assert');

/*GET keys */
router.get('/', async function (req, res, next) {
  let result = await Key.findOne()
  res.send(200, {
    message: 'ok',
    data: {
      pubKey: result.content
    }
  })
});

module.exports = router;
